/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package berkeley.homework3;

class SListNode {
  Object item;
  SListNode next;


  /**
   *  SListNode() (with two parameters) constructs a list node referencing the
   *  item "obj", whose next list node is to be "next".
   */

  SListNode(Object obj, SListNode next) {
    item = obj;
    this.next = next;
  }

  /**
   *  SListNode() (with one parameter) constructs a list node referencing the
   *  item "obj".
   */

  SListNode(Object obj) {
    this(obj, null);
  }
  
  public boolean equals(Object obj) {
      if (!(obj instanceof SListNode)) {
          return false;
      } else {
          return (this.item).equals(((SListNode) obj).item);
      }
  }
}
